<?php
include_once('main_global.php');
$gad=new bn_gadget;
$page=new bn_page;
$gf=new bn_genralfunc;
$theme->add_block('body');
$pid=$gf->Get_number($_GET['pid']);
if(isset($pid))
{
  $row=$page->select_page($pid)->fetch();
  if(empty($row)||$row['status']=='disable') 
  bn_redirect('sample.php'); 
}
else
bn_redirect('sample.php');
?>
<label><?php echo $row['title'] ?></label>
<br /><br />
<span><?php echo $row['text'] ?></span>
<br /><br />
<div id="gadget">
<?php 
if(isset($row['gadget']))
echo $gad->load_gadget($gad->id2dir(25));
 ?>
</div>
<?php	
$theme->render();
?>